<template>
  <div>
      <ul>
          <li v-for="i in novel_list" :key="i">{{i.name}} <ul>
              <van-radio-group v-model="status">
                  <van-radio name=2>通过</van-radio>
                  <van-radio name=3>不通过</van-radio>
              </van-radio-group>
              <button @click="submit(i.id)">提交</button>
              </ul></li>
      </ul>
  </div>
</template>

<script>
import axios from '../../http/axios'
export default {
data () {
    return {
        novel_list:[],
        status:2,
        
    }
},
methods: {
    get_audit(){
        axios('/novel','get').then(res=>{
            console.log(res)
            this.novel_list=res.list
        })
    },
    submit(id){
        axios('/novel?id='+id,'post',{'status':this.status}).then(res=>{
            console.log(res)
            if(res.code==200){
                alert('审批成功')
                this.get_audit()
            }
        })
    }
},
mounted () {
    this.get_audit()
}
}
</script>

<style>

</style>